package com.kl.drs.action;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kl.drs.bean.bo.CCBLCContBO;
import com.kl.drs.bean.bo.DrsAsynchTaskBO;
import com.kl.drs.bean.bo.TaskInfoBO;
import com.kl.drs.common.BusinessKey;
import com.kl.drs.service.BankButtjointService;
import com.kl.drs.service.DrsAsynchTaskService;
import com.kl.drs.service.RecordingAnalysisService;


/**
 * 本地上传
 */
@Transactional
@Service("recordingAction")
public class RecordingAction{

	@Autowired
	private RecordingAnalysisService recordingAnalysisService;

	@Autowired
	private DrsAsynchTaskService drsAsynchTaskService;
	/**
	 * 资料上传
	 * pram：UWTranDataBO
	 */
	public Map uploadRecordingInfo(TaskInfoBO taskInfoBO) throws Exception{
		Map result = new HashMap();
		if(taskInfoBO == null ){
			return null;
		}
		int createFlag = recordingAnalysisService.createOrUpdateRecording(taskInfoBO);
		if(createFlag<1){
			result.put("message", "上传任务失败！");
		}else{
			DrsAsynchTaskBO drsAsynchTask = new DrsAsynchTaskBO();
			drsAsynchTask.setBusinessNo(taskInfoBO.getBusinessNo());
			drsAsynchTask.setBusinessSerialNo(taskInfoBO.getBusinessSerialNo());
			drsAsynchTask.setTaskType(BusinessKey.ASYNCH_TYPE_UB);
			drsAsynchTask.setStatus(BusinessKey.ASYNC_TASK_STATUS_WAIT);
			drsAsynchTaskService.addAsynchTask(drsAsynchTask);
		}
		return result;
	}
	
}
